<style>
    #datatable tr >th,td {
        border: 1px solid #ddd;
    }
    #datatable tr >th {
        text-align: center;
    }
    .numShow {
        text-align: right;
    }
    .city {
        cursor:pointer;
        text-align: center;
    }
</style>
<table style="height: 100%;width:100%;">
    <tr>
        <td>
            <div class="form-inline" style="padding: 10px;background-color: #bdf3dc;">
                <div class="form-group">
                    <label>选择省：</label>
                    <select class="form-control" name="province"  style="width: 140px;">
                        <option value="">请选择</option>
                        {% if province is defined %}
                            {% for id,text in province %}
                            <option value="{{ text  }}" {% if params['province'] is defined and params['province'] == text  %} selected {% endif %}>{{ text }}</option>
                            {% endfor %}
                        {% endif %}
                    </select>
                </div>
                <div class="form-group">
                    <label>学校类型：</label>
                    <select class="form-control" name="schoolType"  style="width: 140px;">
                        <option value="">请选择</option>
                        {% if province is defined %}
                            {% for id,text in schoolType %}
                                <option value="{{ id  }}" {% if params['schoolType'] is defined and params['schoolType']  == id  %} selected {% endif %}>{{ text }}</option>
                            {% endfor %}
                        {% endif %}
                    </select>
                </div>
                <div class="form-group" style="margin-left: 10px;">
                    <label>合作日期：</label>
                    <input id="startTime" name="startTime" type="date"  {% if params['startTime'] is defined  %} value="{{ params['startTime'] }}" {% endif %}  class="form-control">
                </div>
                <div class="form-group">
                    <label>~</label>
                    <input id="endTime" name="endTime" type="date" {% if params['endTime'] is defined  %} value="{{ params['endTime'] }}" {% endif %} class="form-control">
                </div>
                <a  id="bt_view_usage" class="btn btn-success btn-sm"  style="margin-left: 15px;width: 80px;">搜索</a>
                <a  download="{{ fileName }}.xls" href="#"  class="btn btn-success btn-sm" onclick="return ExcellentExport.excel(this, 'datatable', 'xh');" style="margin-left: 15px;width: 80px;">导出</a>
            </div>
        </td>
    </tr>
    <tr style="height: 100%;width:100%;">
        <td valign="top" style="border: 0px">
            <table class="table table-hover" id="datatable" >
                <tbody>
                    <tr class="info">
                        <th style="width: 20%">省</th>
                        <th style="width: 16%">市</th>
                        <th style="width: 16%">学校数</th>
                        <th style="width: 16%">班级数</th>
                        <th style="width: 16%">教师数</th>
                        <th style="width: 16%">学生数</th>
                    </tr>
                    {% if info is defined %}
                        {% for province,rows in info %}
                            {% for city,value in rows %}
                                <tr>
                                    {% if loop.first %} <td style="text-align: center;vertical-align: middle;" rowspan="{{ rows | length }}" {% if province == '合计'  %} colspan="2" {% endif %}>{{ province }}</td> {% endif %}
                                    {% if province <> '合计'  %}
                                        <td class="city" provinceName="{{ province }}">{{ city }}</td>
                                    {% endif %}
                                    <td class="numShow">{{ value['schNum'] }}</td>
                                    <td class="numShow">{{ value['classNum'] }}</td>
                                    <td class="numShow">{{ value['tchNum'] }}</td>
                                    <td class="numShow">{{ value['stuNum'] }}</td>
                                </tr>
                            {% endfor %}
                        {% endfor %}
                    {% endif %}
                </tbody>
            </table>
        </td>
    </tr>
</table>


